import React from 'react';
import './index.less';
import Title from '../../components/title';

function Tsdemo() {
  const isDone: boolean = false;
  const count: number = 6;
  const str: string = `${count}人`;
  const list: number[] = [1, 2, 3];
  let X: [string, number];
  X = ['hello', 4];
  enum Color {
    Red = 1,
    Green,
    blue,
  }
  const c: Color = Color.Green;
  return (
    <div className='ts-demo'>
      <Title title='ts-demo' left={true} />
      <p style={isDone ? { background: 'red' } : { background: 'yellow' }}>isDone</p>
      <p>{count}</p>
      <p>{str}</p>
      {list.map((item, index) => {
        return <p key={index}>{item}</p>;
      })}
      {X.map((item, index) => {
        return <p key={index}>{item}</p>;
      })}
      <p>{c}</p>
    </div>
  );
}
export default Tsdemo;
